<table id="user-table" class="table table-striped table-hover" data-search-form="#user-search-form">
  <thead>
    <tr>
      <th>{{'admin.operation_analysis.income.course'|trans}}</th>
      <th>{{'admin.operation_analysis.income.paid'|trans}}</th>
      <th>{{'admin.operation_analysis.income.price'|trans}}</th>
      <th>{{'admin.operation_analysis.income.discount'|trans}}</th>
      <th>{{'admin.operation_analysis.income.buyer'|trans}}</th>
      <th>{{'admin.operation_analysis.income.buy_time'|trans}}</th>
    </tr>
  </thead>
  <tbody>
    {% if incomeDetail %}
    {% for data in incomeDetail %}
    {% if data.totalPrice|default(null) %}
      <tr>
        <td>{{data.title}}<br>{{'admin.operation_analysis.paid_course.order'|trans}}：{{data.sn}}</td>
        <td class="text-danger">{{data.amount}}</td>
        {% if data.targetType == "course" %}
          <td class="text-danger"> {{courses[data.targetId].price|default("-")}}</td>
        {% elseif data.targetType == "vip" %}
          <td class="text-danger">{{data.totalPrice|default("-")}}</td>
        {% elseif data.targetType == "classroom" %}
          <td class="text-danger">{{classrooms[data.targetId].price|default("-")}}</td>
        {% else %} <td>-</td>
        {% endif %}
        <td>{% if  data.coupon %}{{'admin.operation_analysis.income.discount_code'|trans}}<br>[{{data.coupon}}]{% endif %}</td>
        <td> {{ admin_macro.user_link(users[data.userId]) }}</td>
        <td>{{data.createdTime|date("Y-m-d H:i:s")}}<br>{{data.paidTime|date("Y-m-d H:i:s")}}</td>
      </tr>
      {% else %}
      <tr class="danger">
         <td>{{data.title}}({{'admin.operation_analysis.paid_course.empty'|trans}})<br>{{'admin.operation_analysis.paid_course.order'|trans}}：{{data.sn}}</td>
         <td class="text-danger">{{data.amount}}</td>
         <td class="text-danger"> --</td>
         <td>{% if  data.coupon %}{{'admin.operation_analysis.income.discount_code'|trans}}<br>[{{data.coupon}}]{% endif %}</td>
         <td> {{ admin_macro.user_link(users[data.userId]) }}</td>
         <td>{{data.createdTime|date("Y-m-d H:i:s")}}<br>{{data.paidTime|date("Y-m-d H:i:s")}}</td>
      </tr>
      {% endif %}
    {% endfor %}
    {% endif %}
  </tbody>
</table>
{{ admin_macro.paginator(paginator) }}
